#include "plook_u8f_lincka.h"
#include "linsearch_u8f.h"
#include "rtwtypes.h"

uint8_T plook_u8f_lincka(real32_T u, const real32_T bp[], uint32_T maxIndex)
{
  uint8_T bpIndex;
  if (u <= bp[0U]) {
    bpIndex = 0U;
  } else if (u < bp[maxIndex]) {
    bpIndex = linsearch_u8f(u, bp, maxIndex >> 1U);
  } else {
    bpIndex = (uint8_T)maxIndex;
  }

  return bpIndex;
}
